<?php 
/*
Template Name: Page_upload ajax
*/
?>

<?php

var_dump($_POST['ims']);
return;


echo '<pre>'; print_r($_FILES); echo '</pre>';
if (move_uploaded_file($_FILES['image']['tmp_name'], 'upload_may/' . $_FILES['image']['name'])) {
    echo 'ok';
} else {
    echo 'error!';
};
/*
//include_once($_SERVER['DOCUMENT_ROOT'].'/TTNaNoNangLuong/wp-load.php' );
$base_url= get_bloginfo('template_directory'); 
$uploads_dir = $base_url.'/upload_may';

// nhiem vu di chuyen anh 
//include_once($_SERVER['DOCUMENT_ROOT'].'/TTNaNoNangLuong/wp-load.php' );
//echo $_POST;
//$phuc = json_encode($_POST);
*/
echo ' tra ve mang nhes';
var_dump($_FILES["images"]);
return;

foreach ($_FILES["images"]["error"] as $key => $error) {
    if ($error == UPLOAD_ERR_OK) {
        $name = $_FILES["images"]["name"][$key];
        move_uploaded_file( $_FILES["images"]["tmp_name"][$key], "uploads/" . $_FILES['images']['name'][$key]);
    }
}

echo "<h2>Thêm ảnh mới thành công</h2>";

//<img src="<?php echo get_bloginfo('template_directory').'/upload_may/

